Renders a view using the Freemarker template engine. Alternatively, the com.opensymphony.webwork.dispatcher.ServletDispatcherResult dispatcher result type can be used in conjunction Webwork's {@link FreemarkerServlet}.

The FreemarkarManager class configures the template loaders so that the template location can be either

  • relative to the web root folder. eg /WEB-INF/views/home.ftl
  • a classpath resuorce. eg com/company/web/views/home.ftl

NOTE (bufferOutput attribute):
Allow customization of either (when true) to write result to response stream/writer only when everything is ok (without exception) or otherwise. This is usefull when using Freemarker's "rethrow" exception handler, where we don't want partial of the page to be writen and then exception occurred and we have freemarker's "rethrow" exception handler to take over but its too late since part of the response has already been 'commited' to the stream/writer.

Also see WebWork Freemarker Support.

Parameters

  • location (default) - the location of the template to process.
  • parse - true by default. If set to false, the location param will not be parsed for Ognl expressions.
  • contentType - defaults to "text/html" unless specified.
  • bufferOutput - default to false. If true, will only write to the response if the whole freemarker page could be rendered ok.

Examples

<result name=&quot;success&quot; type=&quot;freemarker&quot;>foo.ftl</result>